<div class="modal-header">
    <h4 class="modal-title">绑定接口</h4>
</div>
<div class="modal-body">

    <form name="form" class="form-horizontal ng-pristine ng-valid-required">
      <div class="form-group">
        <label class="col-lg-2 control-label">查找接口:</label>
        <div class="col-lg-3">
          <ui-select ng-model="searchfrom.center" theme="bootstrap" ng-change="search()">
            <ui-select-match placeholder="选择center...">{{$select.selected.label}}</ui-select-match>
            <ui-select-choices repeat="center in center_list">
              <span ng-bind-html="center.label | highlight: $select.search"></span>
            </ui-select-choices>
          </ui-select>
        </div>
        <div class="col-lg-5">
          <ui-select ng-model="searchfrom.api" theme="bootstrap">
            <ui-select-match placeholder="选择接口..." style="overflow: hidden">
              {{$select.selected.name + $select.selected.id}}
            </ui-select-match>
            <ui-select-choices repeat="info in interface_list | filter: $select.search">
              <span popover-trigger="mouseenter" popover="{{info.id}}">{{info.name + info.id}}</span>
            </ui-select-choices>
          </ui-select>
        </div>
        <label class="col-lg-1">
          <button class="btn btn-success" type="button" ng-click="selectApi()">添加</button>
        </label>
      </div>

      <div class="panel panel-default">
        <div class="panel-heading">{{"接口标识：" + title.id}}</div>
        <table class="table table-striped m-b-none">
          <thead>
            <tr>
              <th style="width: 9%;text-align:center;">绑定接口标识</th>
              <th style="width: 8%;text-align:center;">绑定键</th>
              <th style="width: 4%;text-align:center;">绑定关系</th>
              <th style="width: 8%;text-align:center;">绑定描述</th>
              <th style="width: 2%;"></th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="info in sel_list">
              <td>{{info.bind_function_id}}</td>
              <td><input type="text" class="form-control" ng-model="info.bind_key" ng-disabled="info.status"></td>
              <td>
                <select class="form-control" ng-model="info.bind_relation" ng-disabled="info.status">
                  <option value="">无</option>
                  <option value="=">相等</option>
                  <!--<option value=">">大于</option>
                  <option value="<">小于</option>-->
                </select>
              </td>
              <td><input type="text" class="form-control" ng-model="info.bind_value" ng-disabled="info.status"></td>
              <td style="text-align:center;">
                <button class="btn btn-rounded btn-sm btn-icon btn-success" ng-click="update(info)" ng-if="info.status">
                  <i class="fa fa-pencil"></i>
                </button>
                <button class="btn btn-rounded btn-sm btn-icon btn-success" ng-click="save(info)" ng-if="!info.status">
                  <i class="fa fa-check"></i>
                </button>
                <button class="btn btn-rounded btn-sm btn-icon btn-danger" ng-click="remove($index)">
                  <i class="fa fa-times"></i>
                </button>
              </td>
            </tr>
          </tbody>
        </table>
      </div>

    </form>

</div>

<div class="modal-footer">
  <label class="col-lg-5 control-label text-muted"><i>*温馨提示:绑定信息全部填写或者全部为空,不可以只填写部分内容!!!</i></label>
  <button class="btn btn-danger" type="button" ng-click="cancel()">关闭</button>
</div>

